﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using DAO;


namespace Sklad.WindowsApplication
{
    public partial class AddUserForm : Form
    {
        public AddUserForm()
        {
            InitializeComponent();
        }

        private void bt_add_Click(object sender, EventArgs e)
        {
            var temp = new Employer()
            {
                FIO = this.tb_fio.Text,
                Passport_Number = this.tb_pasnum.Text,
                Passport_Ser = this.tb_passer.Text,
                Login = this.tb_login.Text,
                Password = this.tb_password.Text,
                Is_Admin = this.is_admin.Checked,
            };

            AdminMainForm.dr.EmployeeRepository.Add(temp);
            this.Close();

        }
    }
}
